package com.application.service.Impl;


import com.application.dao.SortDao;
import com.application.domain.sort;
import com.application.service.SortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SortServiceImpl implements SortService{
    @Autowired
    SortDao sortDao;

    @Override
    public List<sort> getAll() {
        List<sort> list = sortDao.selectList(null);
        return list;
    }

    @Override
    public sort getById(String id) {
        sort sort = sortDao.selectById(id);
        return sort;
    }

    @Override
    public int insert(sort sort) {
        int insert = sortDao.insert(sort);
        return insert;
    }

    @Override
    public int update(sort sort) {
        int update = sortDao.update(sort, null);
        return update;

    }

    @Override
    public int deleteById(String id) {
        int deleteById = sortDao.deleteById(id);
        return deleteById;
    }
}
